From: Roan Kattouw Date: Wed, 9 Mar 2011 01:13:17 +0000 (+0000) Subject: Merge r83652 from 1.17wmf1 to trunk: add backwards compatibility from &from= and... X-Git-Tag: 1.31.0-rc.0~31547 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=1bf059cd33ddb4a42a89a84117a7342b5caab7e1;p=lhc%2Fweb%2Fwiklou.git Merge r83652 from 1.17wmf1 to trunk: add backwards compatibility from &from= and &until= on category pages to keep things like alphabet templates working --- diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 5b96a1d84e..a8cae439de 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -70,10 +70,14 @@ class CategoryPage extends Article { function closeShowCategory() { global $wgOut, $wgRequest; + // Use these as defaults for back compat --catrope + $oldFrom = $wgRequest->getVal( 'from' ); + $oldUntil = $wgRequest->getVal( 'until' ); + $from = $until = array(); foreach ( array( 'page', 'subcat', 'file' ) as $type ) { - $from[$type] = $wgRequest->getVal( "{$type}from" ); - $until[$type] = $wgRequest->getVal( "{$type}until" ); + $from[$type] = $wgRequest->getVal( "{$type}from", $oldFrom ); + $until[$type] = $wgRequest->getVal( "{$type}until", $oldUntil ); } $viewer = new $this->mCategoryViewerClass( $this->mTitle, $from, $until, $wgRequest->getValues() ); @@ -344,7 +348,7 @@ class CategoryViewer { array( 'page_id', 'page_title', 'page_namespace', 'page_len', 'page_is_redirect', 'cl_sortkey', 'cat_id', 'cat_title', 'cat_subcats', 'cat_pages', 'cat_files', 'cl_sortkey_prefix' ), - array( 'cl_to' => $this->title->getDBkey() ) + $extraConds, + array_merge( array( 'cl_to' => $this->title->getDBkey() ), $extraConds ), __METHOD__, array( 'USE INDEX' => array( 'categorylinks' => 'cl_sortkey' ),